package com.duoec.magichour.service.impl;

import com.duoec.magichour.core.CommonConst;
import com.duoec.magichour.core.web.UserInfoHolder;
import com.duoec.magichour.dto.UserInfo;
import com.duoec.magichour.service.SiteService;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by ycoe on 17/7/5.
 */
@Service
public class SiteServiceImpl implements SiteService {
    @Override
    public Map<String, Object> commonVars() {
        UserInfo userInfo = UserInfoHolder.get();
        Map<String, Object> vars = Maps.newHashMap();
        vars.put("domain", CommonConst.DOMAIN);
        vars.put("staticUrl", CommonConst.STATIC_URL);
        vars.put("authorize", userInfo);
        return vars;
    }
}
